cmake_minimum_required(VERSION 3.13)
project(redis-starter-cpp)
set(CMAKE_CXX_STANDARD 20) # Enable the C++20 standard

set(SOURCE_FILES src/Server.cpp)
# 添加 -g 选项
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_BUILD_TYPE Debug)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    # add_definitions(-DDEBUG)
endif()

# 头文件搜索路径
include_directories(${PROJECT_SOURCE_DIR}/include)

# 获取所有源文件列表
file(GLOB_RECURSE SOURCES "src/*.cpp" "include/*.h" "test/*.cc")

enable_testing()
add_executable(server ${SOURCE_FILES} ${SOURCES})


target_link_libraries(
  server
  -lgtest_main
  -lgtest
)

include(GoogleTest)
gtest_discover_tests(server)